< previous page page_580 next page >

Page 580
Chapter Objectives
Learn to read and write INI files
Create an INI class
Learn about the system Registry
Learn to use the Registry API calls
Learn to use GetSetting and SaveSetting
Create a Registry class
Sample Project File: \Chapter29\UserStorage.vbp
INI Files
An INI file is simply a text file with a predefined structure. The structure is very simple, so retrieving information from it is very easy. An INI file has one or more sections defined by square brackets ([]) around a user-defined name. Next, youll see a defined key name, an equal sign (=), and then a value for that key. Heres an example:
9f31265bb40b592b1929e18a47ab28e5.gif
; UserStorage.ini
[Database]
Path=D:\Database\
File=Employee.mdb
JetMDB=-1
OnServer=0
Version=1.1.1

[Env]
Toolbar=-1
StatusBar=0
Menus=-1
In this listing, [Database] is a section, Path= is a key name, and D:\Database\ is the value for the Path key. To retrieve and write this information, you need to use some API calls. Lets look at each one, in turn, in the first example (see Figure 29.1).
Examples Filename: INI.frm

 
< previous page page_580 next page >

If you like this book, buy it!